import { LIST_DATA } from '../action/actionTypes'
const initState = {
    list: []
}

const getLisData = (state, action) => {
    if (action.currentPage === 0) {
        return {
            ...state,
            list: action.obj.data.poilist
        }
    } else {
        let list = state.list;
        return { ...state, list: list.concat(action.obj.data.poilist) }
    }
}

const contentListReducer = (state = initState, action) => {
    switch (action.type) {
        case LIST_DATA: return getLisData(state, action);
        default: return state
    }
}
export default contentListReducer